package com.karson.service.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.karson.common.model.BehaviorWeight;
import com.karson.service.service.BehaviorWeightService;
import com.karson.service.dao.BehaviorWeightMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
* @author ZKS
* @description 针对表【ar_behavior_weight(行为权重配置表)】的数据库操作Service实现
* @createDate 2025-09-21 19:44:00
*/
@Service
public class BehaviorWeightServiceImpl extends ServiceImpl<BehaviorWeightMapper, BehaviorWeight>
    implements BehaviorWeightService{

    @Autowired
    private BehaviorWeightMapper behaviorWeightMapper;

    @Override
    public IPage<BehaviorWeight> pageList(IPage<BehaviorWeight> behaviorWeightPage) {
        return behaviorWeightMapper.pageList(behaviorWeightPage);
    }

    @Override
    public BehaviorWeight getBehaviorWeightByAction(String actionType) {
        LambdaQueryWrapper<BehaviorWeight> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.eq(BehaviorWeight::getBehavior, actionType);
        return getOne(queryWrapper);
    }
}




